package org.jeecg.modules.complain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.complain.entity.ComplainStatus;

import java.util.List;

/**
 * @Description: 投诉配置
 * @Author: jeecg-boot
 * @Date:   2019-09-03
 * @Version: V1.0
 */
public interface ComplainStatusMapper extends BaseMapper<ComplainStatus> {
  @Select("select * from complain_status where complain_id =#{complainId} and status=#{status} and del_flag='0'")
  ComplainStatus selectStatus(@Param("complainId") String complainId,@Param("status")Integer status);
  @Update("update complain_status set  del_flag ='1' where id =#{id} and status =#{status}")
   void  deleteByComplainId(ComplainStatus complainStatus);
  @Select("select * from complain_status where complain_id = #{complainId} order By create_time desc")
    List<ComplainStatus> selectAll(@Param("complainId")String complainId);
}
